package com.wanke.config;

import com.wanke.client.AuthClient;
import com.wanke.client.MeasureClient;
import feign.VertxFeign;
import feign.jackson.JacksonDecoder;
import feign.jackson.JacksonEncoder;
import io.vertx.core.Vertx;

public class HttpConfig   {


    public static MeasureClient measureClient;

    public static AuthClient authClient;

    public synchronized  static void init(Vertx vertx,String host) {
        measureClient = VertxFeign
                .builder()
                .vertx(vertx)
                .decoder(new JacksonDecoder())
                .encoder(new JacksonEncoder())
                .target(MeasureClient.class, host + "yh-data-transfer");
        authClient = VertxFeign
                .builder()
                .vertx(vertx) // provide vertx instance
                .decoder(new JacksonDecoder())
                .encoder(new JacksonEncoder())
                .target(AuthClient.class, host + "yh-authority");
    }
}
